#include <hidef.h> /* for EnableInterrupts macro */
#include "Headers/derivative.h" /* include peripheral declarations */
#include "Headers/interrupt.h"
#include "Headers/define.h"
#include "Headers/232.h"
unsigned char *rx_232, rx_flag;
void interrupt VectorNumber_Virq irqpin(void){
	IRQSC |= IRQSC_IRQACK_MASK;   		// clear flag for the IRQ interrupt pin 
}
/*
* rx_interrupt this function only set a flag when a enter is received 
*
*/
void interrupt VectorNumber_Vsci2rx rx_interrupt(void){
  char x, error_fn;
  int count = 0, rta_fn = 0;
   ld2 ^= 1;
   x = SCI2S1;
   x = SCI2D;
   while(rx_232[count] != 0)count++;
   if(count < 100 && x != '\b') rx_232[count++] = x;
   else if(count < 100) rx_232[count-1] = 0;
   error_fn = send_232("\r");
   error_fn = send_232(rx_232);
   if(x == 13){
    rx_flag = 1;
    count = 0;
    
   }
   ld2 ^= 1;
}